﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using TarreOA.TarreOADAL;
using TarreOA.TarreOAModels;

namespace TarreOA.TarreOABLL
{
    public class PublicCommunicationGroupService
    {
        /// <summary>
        /// 保存新建的通讯组信息
        /// </summary>
        /// <param name="comGroupName"></param>
        /// <returns></returns>
        public int saveComGroupInfo(string comGroupName)
        {
            PublicCommunicationGrouptbDAO pcgDAO = new PublicCommunicationGrouptbDAO();
            return pcgDAO.saveComGroupInfo(comGroupName);
        }

         /// <summary>
        /// 查找所有公共通讯组信息
        /// </summary>
        /// <returns></returns>
        public List<PublicCommunicationGrouptb> findALL()
        {
            PublicCommunicationGrouptbDAO pcgDAO = new PublicCommunicationGrouptbDAO();
            return pcgDAO.findALL();
        }

        /// <summary>
        /// 根据通讯组编号查找通讯组信息
        /// </summary>
        /// <param name="cgid"></param>
        /// <returns></returns>
        public PublicCommunicationGrouptb findById(int cgid)
        {
            PublicCommunicationGrouptbDAO pcgDAO = new PublicCommunicationGrouptbDAO();
            return pcgDAO.findById(cgid);
        }

        /// <summary>
        /// 根据通讯组编号更新通讯组信息
        /// </summary>
        /// <param name="cgid"></param>
        /// <param name="cgName"></param>
        /// <param name="lwtime"></param>
        /// <returns></returns>
        public int updateGroupInfoById(int cgid, string cgName, DateTime lwtime)
        {
            PublicCommunicationGrouptbDAO pcgDAO = new PublicCommunicationGrouptbDAO();
            return pcgDAO.updateGroupInfoById(cgid, cgName, lwtime);
        }

         /// <summary>
        /// 根据通讯组编号删除通讯组信息
        /// </summary>
        /// <param name="cgid"></param>
        /// <returns></returns>
        public int delById(int cgid)
        {
            PublicCommunicationGrouptbDAO pcgDAO = new PublicCommunicationGrouptbDAO();
            return pcgDAO.delById(cgid);
        }
    }
}
